package com.tfjybj.msg.commons.entity.table;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * @Description:
 * @Author: xuziguo
 * @Date: 2021/4/19 下午 7:34
 * @Modified By:
 * @Modify Date:
 */
@EntityListeners(AuditingEntityListener.class) //自定义实体的id策略-用雪花算法用
@Entity
@Table(name = "message", schema = "msg_v2_dev")
@Data
@AllArgsConstructor
@NoArgsConstructor
public class MessageEntity {

    @Id
    @CreatedBy
    @Column(name = "id") //自定义实体的id策略-雪花算法用
    private String id;

    @Column(name = "message_title")
    private String messageTitle;

    @Column(name = "message_content")
    private String messageContent;

    @Column(name = "message_type")
    private String messageType;

    @Column(name = "state")
    private String state;

    @Column(name = "sender")
    private String sender;

    @CreatedDate
    @Column(name = "create_time")
    private Timestamp createTime;

    @LastModifiedDate
    @Column(name = "update_time")
    private Timestamp updateTime;

    @Column(name = "is_delete")
    private Integer isDelete;
}
